package com.bawei.module_mine.utils

import com.bawei.module_mine.BaseApplication
import com.bawei.module_mine.websocket.WebSocketUtils
import org.java_websocket.handshake.ServerHandshake

object WebSocketInit {

    fun init(application: BaseApplication) {
        BaseApplication.initWebSocket(object : WebSocketUtils.ReceiveMsgListener {
            override fun onReceive(message: String) {
                // 处理收到的消息
            }

            override fun onOpen(handshakedata: ServerHandshake) {
                // 连接打开
            }

            override fun onError(ex: Exception) {
                // 错误处理
            }

            override fun onClose(code: Int, reason: String, remote: Boolean) {
                // 连接关闭
            }
        })
    }
}